package com.patterns.strategy;

import java.util.Arrays;

/**
 * @author fwj
 * @date 2021/4/21 11:31
 **/
public class Main {
    public static void main(String[] args) {
//        int[] a = {9, 2, 8, 3, 5, 7, 1, 4};
        Dog[] dogs = {new Dog(3), new Dog(5), new Dog(1)};
        Sorter<Dog> sorter = new Sorter();
        //可以传入不通的比对器（对比策略）
        sorter.sort(dogs, new DogComparator());
        System.out.println(Arrays.toString(dogs));
    }
}
